\name{RegSurfaceDemo}
\alias{RegSurfaceDemo}
\title{Demonstrate a Regression Surface}
\description{Provides a simple interface to plot a regression surface for 2 variables.  It _only_ works with 2 variables (not 1 or more than 2).}
\usage{
RegSurfaceDemo(formula, data, xlim = NULL, ylim = NULL,
  zlim = NULL, resolution = 10)
}
\arguments{
  \item{formula}{\code{formula} is a basically formula object as in \code{lm}
}
  \item{data}{\code{data} the dataset where the variables can be found.
}
  \item{xlim}{\code{xlim} set the limits for the x axis.
}
  \item{ylim}{\code{ylim} set the limits for the y axis.
}
  \item{zlim}{\code{zlim} set the limits for the z axis.
}
  \item{resolution}{\code{resolution} sets how many points to calculate to smooth the regression surface over.
}
}
\details{This can be used just like a simple call to \code{lm} right now.  Eventually it may be expanded to include other types of models and more complex surfaces.}
\value{Print a summary of the model (currently only from \code{lm}) used to calculate the regression surface and also plots the regression surface.
}
%% \references{}
\author{Joshua Wiley, \url{http://joshuawiley.com/}}
\note{I am actually rather fond of this for visually (and easily) demonstrating an interaction, so I want to write some decent documentation for it when I have more time.
}

\seealso{\code{\link{lm}}}
\examples{
require(rgl)
## No interaction
RegSurfaceDemo(mpg ~ hp + wt, data = mtcars)

## Demonstrating a large interaction
RegSurfaceDemo(mpg ~ hp * wt, data = mtcars)
}
\keyword{hplot}
